<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    

    <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title><?php echo C('WEB_SITE_TITLE');?></title>
    
    <meta name="keywords" content="">
    <meta name="description" content="">
    
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/Admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/Admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/Admin/css/animate.min.css" rel="stylesheet">
    <link href="/Admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <script src="/Admin/js/jquery.min.js?v=2.1.4"></script>
    
    <style>
        .status{
            color: #FFF;
        }
        .status-0{
            background-color: #f8ac59;
        }
        .status-1{
            background-color: #1ab394;
        }
        .status-2{
            background-color: #ed5565;
        }
    </style>
</head>
<body>

</body>
</html>

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>菜单管理</h5>
        </div>
        <div class="ibox-content">
            <div class="row row-lg">
                
                <div class="col-sm-12">
                    <div class="clearfix" style="width:100%;">
                        <div class="bars pull-left"><div class="btn-group hidden-xs" id="exampleTableEventsToolbar" role="group">
                            <?php if(I('get.pid',0) != 0): ?><button type="button" class="btn btn-outline btn-default" onclick="window.history.go(-1);">
                                    <i class="glyphicon glyphicon-chevron-left" aria-hidden="true"></i>
                                </button><?php endif; ?>
                            <button type="button" class="btn btn-outline btn-default" href="<?php echo U('Menu/edit',['pid'=>I('get.pid',0)]);?>">
                                <i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
                            </button>
                            <button type="button" class="btn btn-outline btn-default confirm" form="form" action="<?php echo U('Menu/delete');?>">
                                <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                            </button>
                        </div></div>
                        <div class="columns columns-right btn-group pull-right" style="margin-left: 5px;">
                            <button class="btn btn-default btn-outline" type="button" name="refresh" title="刷新" href="/admin.php/Menu/index/pid/132.html"><i class="glyphicon glyphicon-repeat"></i></button>
                        </div>
                        <div class="pull-right search">
                            <input class="form-control input-outline" type="text" placeholder="搜索">
                        </div>
                    </div>
                    <div class="table-responsive">
                        <form id="form" method="post">
                            <table class="table table-hover">
                                <thead>
                                <tr>
                                    <th>
                                        <label>
                                            <input type="checkbox" name="checkAll" child="del-check">
                                            <span>全选</span>
                                        </label>
                                    </th>
                                    <th>名称</th>
                                    <th>上级菜单</th>
                                    <th>分组</th>
                                    <th>URI</th>
                                    <th>排序</th>
                                    <th>仅开发模式显示</th>
                                    <th>隐藏</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$info): $mod = ($i % 2 );++$i;?><tr>
                                            <th>
                                                <label style="cursor: pointer; width: 100%;height: 100%;">
                                                    <input class="del-check" name="id[]" type="checkbox" class="checkbox" value="<?php echo ($info["id"]); ?>">
                                                    <span></span>
                                                </label>
                                            </th>
                                            <td><a href="<?php echo U('Menu/index',['pid'=>$info['id']]);?>"><?php echo ($info["title"]); ?></a></td>
                                            <td><?php echo ($info["pid"]); ?></td>
                                            <td><?php echo ($info["group"]); ?></td>
                                            <td><?php echo ($info["url"]); ?></td>
                                            <td><?php echo ($info["sort"]); ?></td>
                                            <td><?php echo ($info["is_dev_text"]); ?></td>
                                            <td><?php echo ($info["hide_text"]); ?></td>
                                            <td><?php echo ($info["status_text"]); ?></td>
                                            <td>
                                                <button type="button" href="<?php echo U('Menu/edit',array('id'=>$info['id']));?>" class="btn btn-white btn-sm"><i class="fa fa-edit"></i> 编辑 </button>
                                                <button type="button" href="<?php echo U('Menu/delete',array('id'=>$info['id']));?>" class="btn btn-white btn-sm confirm"><i class="fa fa-trash"></i> 删除 </button>
                                            </td>
                                        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                                </tbody>
                            </table>
                        </form>
                    </div>
    
                    <ul class="pagination">
                        <?php echo ($page); ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!-- End Panel Other -->
</div>
<!--<script src="/Admin/js/jquery.min.js?v=2.1.4"></script>-->
<script src="/Admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/Admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/Admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/Admin/js/plugins/layer/layer.min.js"></script>
<script src="/Admin/js/hplus.min.js?v=4.1.0"></script>
<script src="/Admin/js/contabs.min.js"></script>
<script src="/Admin/js/plugins/pace/pace.min.js"></script>
<script>
    $("button").on('click',function(){
        if ( $(this).hasClass("confirm") ) {
            if ( !confirm("确定要执行操作吗?") ) {
                console.log("取消操作");
                return;
            } else {
                console.log("继续操作");
            }
        }
        var href = $(this).attr("href");
        var form = $(this).attr("form");
        var action = $(this).attr("action");
        if ( href ){
            window.location.href = href;
        } else if ( form && action ) {
            $("#"+form)
                .attr("action",action)
                .submit();
        }
    });

    $("input[name=checkAll]").on('change',function(){
        console.log("改变了");
        console.log($(this).prop("checked"));
        var child = $(this).attr("child");
        if ( $(this).prop("checked") ) {
            $("."+child).prop("checked",true);
        } else {
            $("."+child).prop("checked",false);
        }
    });

</script>

<script src="/Admin/js/content.min.js?v=1.0.0"></script>
</body>
</html>